package com.galaxy.service.entity.system;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.galaxy.commom.base.serializer.DateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 用户实体
 *
 * @author caijinbang
 * @date 2018/9/12 12:35
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "user")
public class User implements Serializable{

    /**
     * 用户id
     */
    @TableId
    private String id;

    /**
     * 登录用户名
     */
    private String userName;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 密码
     */
    private String password;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 用户角色列表
     */
    @TableField(exist = false)
    private List<Role> roles;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 省市县地址
     */
    private String address;

    /**
     * 街道地址
     */
    private String street;

    /**
     * 性别
     */
    private Integer sex;

    /**
     * 用户头像
     */
    private String avatar;

    /**
     * 用户类型
     */
    @ApiModelProperty(value = "用户类型 0普通用户 1管理员")
    private Integer type = 0;

    /**
     * 描述/详情/备注
     */
    @ApiModelProperty(value = "描述/详情/备注")
    @Column(name = "")
    private String description;

    /**
     * 创建时间
     */
    private Date createDate;
}
